module.exports = function (app) {
  const {
    Bone,
    DataTypes: { STRING, DATE, JSON, BIGINT },
  } = app.model;
  class Dept extends Bone {
    static table = 'dept';
    static attributes = {
      id: {
        type: BIGINT,
        primaryKey: true,
      },
      parentId: {
        type: BIGINT,
      },
      name: {
        type: STRING,
      },
      // 状态(1-正常；0-停用)
      status: {
        type: BIGINT,
        defaultValue: 1
      },
      // 显示顺序
      sort: {
        type: BIGINT,
        defaultValue: 2,
      },
      createdAt: {
        type: DATE,
      },
      updatedAt: {
        type: DATE,
      },
      deleteAt: {
        type: DATE,
      },
    };
  }
  return Dept;
};
